<template>
    <div style="margin-bottom: 50px;">
        <div class="content" v-if="parentCode"><span class="subTile"></span>{{parentCode}} {{parentDesc}}</div>
        <div class="title">{{options.base.indexCode + " " + options.base.indexDesc}}</div>
        <div class="title">自评能力等级：{{options.eva.reginEvalScore}}</div>
        <div class="content"><span class="subTile">自评概述：</span>{{options.eva.reginEvalLack}}</div>
        <div class="content"><span class="subTile">不足：</span>{{options.eva.reginEvalBiz}}</div>
        <div class="content"><span class="subTile">上传材料：</span></div>
        <div class="content" v-for="(file,index) of options.eva.affixList" :key="index"><span class="subTile">{{file.affixName}}</span></div>
    </div>
</template>

<script>
export default {
    props: {
        options : {
            type : Object,
            default: (() => {
                return {}
            })
        }
    },
    data(){
        return {
            recordData : [],
            parentCode : "",
            parentDesc : "",
        }
    },
    async mounted () {
        let parentTarget = await this.getParentTarget();
        console.log('🚀 ~ parentTarget', parentTarget);
        let parent = parentTarget.filter((item) => {
            return item.indexId === this.options.base.biz2
        })
        if(parent.length > 0){
            this.parentCode = parent[0].indexCode;
            this.parentDesc = parent[0].indexDesc;
        }
        this.options.base.anIndexAbilityOptionsList = this.options.base.anIndexAbilityOptionsList.sort(wfy.sortBy('status'))
        // console.log('🚀 ~ this.options.base.anIndexAbilityOptionsList', this.options.base)
        this.options.base.anIndexAbilityOptionsList.forEach((item) => {
            this.recordData.push({
                name: this.options.base.indexCode + " " + this.options.base.indexDesc,
                lever: item.status + "、" + item.optionsDesc
            })
        })
    },
    methods: {
        // 修改 table cell边框的背景色，行高，字体大小
        tableCellStyle() {
            return 'border-color: black; font-size:20px;height:50px'
        },
        // 修改 table header cell的背景色，行高，字体大小
        tableHeaderCellStyle() {
            return 'border-color: black; color: black; background:#FFFFFF;font-size:20px;height:50px'
        },
        objectSpanMethod({ row, column, rowIndex, columnIndex }) {
            if (columnIndex === 0) {
                if (rowIndex % 5 === 0) {
                    return {
                        rowspan: 5,
                        colspan: 1
                    };
                } else {
                    return {
                        rowspan: 0,
                        colspan: 0
                    };
                }
            }
        },
        getParentTarget(){
            return new Promise((resolve, reject) => {
                this.$http({
                    url: this.$http.adornUrl(`/admin/basIndex/listall`),
                    method: 'get',
                    params: this.$http.adornParams({
                        "biz1": "1"
                    })
                }).then(({ data }) => {
                    console.log('🚀 ~ data', data)
                    resolve(data);
                })
            })
        },
    }
}
</script>

<style lang="scss" scoped>
.title{
    font-size: 20px;
    font-weight: bold;
    line-height: 40px;
}
.subTile{
    font-size: 20px;
    font-weight: bold;
}
.content{
    font-size: 24px;
    line-height: 30px;
    margin-bottom: 20px;
    font-weight: bold;
}
</style>
